require("SOD/model/DrawModel")
require("SOD/tools/observers/FootprintObserver")
require("SOD/tools/observers/PointArrayObserver")

module SOD
  
  class DrawFootprint < DrawModel
      
    def initialize
      super
    end
    
    def draw
      super
      
        originalLayer = Sketchup.active_model.active_layer
        activeLayer = Sketchup.active_model.layers.add "Footprints"
        Sketchup.active_model.active_layer = activeLayer
        face = Sketchup.active_model.active_entities.add_face @pts
        #@pts.each do |pt|
        #  pointObserver = PointArrayObserver.new
        #  pt.add_observer pointObserver
        #end
        face.isFootprint = true
        @footprintObserver = FootprintObserver.new
        face.add_observer @footprintObserver
        face.material = "SOD_Footprint"
        Sketchup.active_model.active_layer = originalLayer
    end
      
  end
  
end
